
module.exports = {
  ifAddInPool () {
    let avRate = this.analysisInfo15m.before10DaysAvMaxWave
    if (avRate < 0.3) {
      avRate = 0.3
    }
    if (
      (this.analysisInfo15m.highLowRate / avRate) > 20 &&
       this.analysisInfo15m.highLowRate > 12
    ) {
      this.addPool = true
    }
    if (this.analysisInfo15m.highLowRate > 12) {
      this.addPool = true
    }
  },
  ifCanAddPoolIfOnlyKong () {

  },
  ifCanAddPoolIfOnlyDuo () {
  },
  ifCanAddPoolIfLikeKong () {
  },
  // 15分钟进攻
  ifCanAddPoolIfAttack15m () {
  },
  ifWarnAbnormal () {
    if (!this.analysisInfo4h.hasFullData) {
      return false
    }
    if (
      this.analysisInfo15m.lastNetChangeRatioUpDays >= 12 &&
      this.analysisInfo15m.netChangeRatioDownDays === 1
    ) {
      // 似乎会一直跌，再监控看看
      return {
        code: this.btbItem.code,
        type: '监控-1',
        priceChangePercent: this.analysisInfo15m.netChangeRatio,
        remark: ''
      }
    }
    if (
      this.analysisInfo15m.netChangeRatio2Days <= -25 &&
      this.analysisInfo15m.netChangeRatioList[1] <= -10 &&
      this.analysisInfo15m.netChangeRatioList[0] <= -10
    ) {
      return {
        code: this.btbItem.code,
        type: '监控-2',
        priceChangePercent: this.analysisInfo15m.netChangeRatio,
        remark: ''
      }
    }
    if (
      this.analysisInfo15m.lastKdjUpDays >= 24 &&
      this.analysisInfo15m.kdjDownDays === 1
    ) {
      return {
        code: this.btbItem.code,
        type: '监控-3',
        priceChangePercent: this.analysisInfo15m.netChangeRatio,
        remark: ''
      }
    }
    // 15m的kdj保持了21天也还会继续涨，比如coai，而且是暴涨，所以限制在24
    if (
      this.analysisInfo15m.lastKdjDownDays >= 24 &&
      this.analysisInfo15m.kdjUpDays === 1
    ) {
      return {
        code: this.btbItem.code,
        type: '监控-4',
        priceChangePercent: this.analysisInfo15m.netChangeRatio,
        remark: ''
      }
    }
    if (
      this.analysisInfo15m.netChangeRatio >= 15 ||
      this.analysisInfo15m.netChangeRatio <= -15 ||
      this.analysisInfo15m.highOpenRate >= 20 ||
      this.analysisInfo15m.lowOpenRate <= -20
    ) {
      return {
        code: this.btbItem.code,
        type: '15m',
        priceChangePercent: this.analysisInfo15m.netChangeRatio,
        remark: ''
      }
    }
    // 会不停出信号
    // if (
    //   this.analysisInfo1h.netChangeRatio >= 30 ||
    //   this.analysisInfo1h.netChangeRatio <= -30
    // ) {
    //   return {
    //     code: this.btbItem.code,
    //     type: '1h',
    //     priceChangePercent: this.analysisInfo1h.netChangeRatio,
    //     remark: ''
    //   }
    // }
    return false
  }
}
